package com.ruoyi.ora.netty.channel.base;

import com.ruoyi.ora.netty.channel.domain.OutMessage;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;

public class TcpEncoderBaseHandler extends MessageToByteEncoder<OutMessage> {

    @Override
    protected void encode(ChannelHandlerContext ctx, OutMessage msg, ByteBuf out) {
        // 消息出口，  可以干点事
        out.writeBytes(msg.getBytes());
    }
}
